﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ITJZ.BitHelper.APIModel;
using System.Xml;

namespace ITJZ.BitHelper.IAPI
{
    /// <summary>
    /// 知识API接口类
    /// </summary>
    public interface IKnowledge
    {
        /// <summary>
        /// 获取目录
        /// </summary>
        /// <returns>
        /// 
        /// </returns>
        XmlDocument Menu();

        /// <summary>
        /// 列出一个库中的函数标题+guid
        /// </summary>
        /// <returns></returns>
        XmlDocument LibList();

        /// <summary>
        /// 新建知识
        /// </summary>
        /// <param name="language">语言名</param>
        /// <param name="library">所属类库</param>
        /// <param name="fullName">知识全名</param>
        /// <param name="content">知识内容</param>
        /// <returns></returns>
        ResInfo Add(string language,string library,string fullName,string content);//添加知识

        /// <summary>
        /// 搜索知识
        /// </summary>
        /// <param name="language">搜索语言范围</param>
        /// <param name="library">所在库</param>
        /// <param name="key">搜索关键词</param>
        /// <returns>返回xml格式化的知识列表（List~类型）</returns>
        List<Knowledge> Search(string language,string library ,string key);//搜索知识

        /// <summary>
        /// 根据guid获取知识详细内容
        /// </summary>
        /// <param name="guid">知识的guid</param>
        /// <returns></returns>
        Knowledge GetKnowledge(string guid);


        /// <summary>
        /// 对知识投票
        /// </summary>
        /// <param name="knowledgeGuid"></param>
        /// <param name="score">得分</param>
        /// <returns></returns>
        ResInfo Vote(string knowledgeGuid, int score);//投票
    }
}
